package com.xiahui.day01;

/**
 * 算术运算符
 */
public class TestMathOperator {
    public static void main(String[] args) {
        int a = 10;
        int b = 20;
        System.out.println(a + b);//30
        System.out.println(a - b);//-10
        System.out.println(a * b);//200
        System.out.println(a / b);//0  a，b都为int类型所以结果也为int类型0而不是float类型0.5
        int c = 3;
        System.out.println(a % c);//取余

        System.out.println("---------------------------------------------------");

        int d=10;
        d++;
        System.out.println("d = " + d);//11

        int e=10;
        int f=e++;
        System.out.println("f = " + f);
        System.out.println("e = " + e);


        int g=10;
        int h=++g;
        System.out.println("h = " + h);
        System.out.println("g = " + g);

    }
}
